<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <title>购物车</title>
    <link rel="stylesheet" type="text/css" href="css/base.css"/>
    <link rel="stylesheet" type="text/css" href="css/shopcar.css"/>
    <link rel="stylesheet" type="text/css" href="css/mui.min.css"/>
    <link rel="stylesheet" type="text/css" href="css/loaders.min.css"/>
    <link rel="stylesheet" type="text/css" href="css/loading.css"/>
    <link rel="stylesheet" type="text/css" href="sourse/layer/mobile/need/layer.css">
    <script src="/shop/js/jquery.min.js" type="text/javascript"></script>
    <script src="/js/plugins/jrender/jrender.min.js"></script>
    <script src="js/rem.js"></script>
    <script src="sourse/layer/mobile/layer.js"></script>
    <script src="/js/plugins/dialog2/dialog.min.js"></script>

    <script type="text/javascript">
        $(window).load(function () {
            $(".loading").addClass("loader-chanage");
            $(".loading").fadeOut(300)
        });

        $(function () {
            var oid;
            //获取当前作用域用户的中的id
            var user = JSON.parse(sessionStorage.getItem("user"));
            //获取当前用户的未支付的订单
            $.get("/orders/car", {type: 1, userId: user.id}, function (data) {
                    oid = data.list[0].id;
                    console.log(data);
                    console.log(data.list[0].id);
                    $(".warp").renderValues(data, {
                        getHref: function (item, value) {
                            $(item).attr('href', $(item).data('href') + value + "&oid=" + oid)
                        }
                    });
                }
            )
        })
    </script>
</head>
<!--loading页开始-->
<div class="loading">
    <div class="loader">
        <div class="loader-inner pacman">
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
        </div>
    </div>
</div>
<!--loading页结束-->
<body>
<!--header star-->
<header class="mui-bar mui-bar-nav" id="header">
    <a class="btn" href="javascript:history.go(-1)">
        <i class="iconfont icon-fanhui"></i>
    </a>
    <h4>购物车</h4>
</header>
<!--header end-->

<div class="warp warptwo clearfloat">
    <div class="shopcar clearfloat" render-loop="list">
        <div class="list clearfloat fl">
            <a href="javascript:void(0)">
                <div class="tu clearfloat fl">
                    <span></span>
                    <a data-href="confirm.html?id=" render-key="list.product.id" render-fun="getHref">
                        <img render-src="list.product.productImg"/>
                    </a>
                </div>
                <div class="right clearfloat fl">
                    <p class="tit over" render-html="list.product.productName"></p>
                    <p class="jifen over"><samp id="jifen" render-html="list.product.productPrice"></samp>积分</p>
                    <div class="bottom clearfloat">
                        <div class="zuo clearfloat fl">
                            <ul>
                                <li><img src="/shop/images/jian.jpg"/></li>
                                <li render-html="list.orderNum">1</li>
                                <li><img src="/shop/images/jia.jpg"/></li>
                            </ul>
                        </div>
                    </div>
                </div>
            </a>
        </div>
    </div>
</div>
<!--footer star-->
<footer class="page-footer fixed-footer" id="footer">
    <ul>
        <li>
            <a href="shop.html">
                <i class="iconfont icon-shouye"></i>
                <p>首页</p>
            </a>
        </li>
        <li>
            <a href="cation.html">
                <i class="iconfont icon-icon04"></i>
                <p>分类</p>
            </a>
        </li>
        <li class="active">
            <a href="shopcar.html">
                <i class="iconfont icon-gouwuche"></i>
                <p>购物车</p>
            </a>
        </li>
        <li>
            <a href="center.html">
                <i class="iconfont icon-yonghuming"></i>
                <p>我的</p>
            </a>
        </li>
    </ul>
</footer>
<!--footer end-->
</body>

</html>
